<?php
namespace app\common\model;
use think\Model;

class Friendship extends Model
{
    // 定义表名
    protected $table = 'fa_friendships';

    // 关联用户
    public function user1()
    {
        return $this->belongsTo('User', 'user_id1');
    }

    public function user2()
    {
        return $this->belongsTo('User', 'user_id2');
    }
}